# 不可变类型: 整数,浮点数,字符串,元组
# 整数
a1 = 10
b1 = 10
c1 = a1
print(a1, b1, c1)
print(id(a1), id(b1), id(c1))
print('-----------------------------------------------')
# 浮点数
a2 = 3.14
b2 = 3.14
c2 = a2
print(a2, b2, c2)
print(id(a2), id(b2), id(c2))
print('-----------------------------------------------')
# 字符串
a3 = "你好"
b3 = "你好"
c3 = a3
print(a3, b3, c3)
print(id(a3), id(b3), id(c3))
print('-----------------------------------------------')
# 元组
a4 = (1, 2, 3)
b4 = (1, 2, 3)
c4 = a4
print(a4, b4, c4)
print(id(a4), id(b4), id(c4))
"""
结论
不可变类型: 都没有开辟新的空间,都只是引用地址传递
"""
print('============================================================')
# 可变类型: 列表,集合,字典
# 列表
a5 = [1, 2, 3]
b5 = [1, 2, 3]
c5 = a5
print(a5, b5, c5)
print(id(a5), id(b5), id(c5))
print('-----------------------------------------------')
# 集合
a6 = {1, 2, 3}
b6 = {1, 2, 3}
c6 = a6
print(a6, b6, c6)
print(id(a6), id(b6), id(c6))
print('-----------------------------------------------')
# 字典
a7 = {1: 'a', 2: 'a', 3: 'a'}
b7 = {1: 'a', 2: 'a', 3: 'a'}
c7 = a7
print(a7, b7, c7)
print(id(a7), id(b7), id(c7))
"""
结论
可变类型: 直接赋值字面量就是开辟了新的空间,但是变量传递的还是引用地址
"""


